package com.neudu.glsb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neudu.glsb.mapper.EmployeeLeaveMapper;
import com.neudu.glsb.pojo.EmployeeLeave;
import com.neudu.glsb.service.EmployeeLeaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class EmployeeLeaveServiceImpl extends ServiceImpl<EmployeeLeaveMapper, EmployeeLeave> implements EmployeeLeaveService {
    @Autowired
    private EmployeeLeaveMapper employeeLeaveMapper;

    // 根据 ID 查询请假申请详情并获取员工姓名
    @Override
    public EmployeeLeave getLeaveByIdWithEmployeeName(Integer id) {
        return employeeLeaveMapper.selectEmployeeLeaveByIdWithEmployeeName(id);
    }
    // 根据审批状态和员工姓名进行查询
    @Override
    public List<EmployeeLeave> getLeavesByStatusAndEmployeeName(String status, String employeeName) {
        return employeeLeaveMapper.selectLeavesByStatusAndEmployeeName(status, employeeName);
    }

    @Override
    public List<EmployeeLeave> searchByName(String employeeName) {
        return employeeLeaveMapper.searchByName(employeeName);
    }

}